<!DOCTYPE html>
<html>
<head>
    <title>患者报道</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <meta name="description" content="">

    <link rel="stylesheet" href="/lib/weui.min.css">
    <link rel="stylesheet" href="/css/jquery-weui.css">
    <link rel="stylesheet" href="/css/home.css">
    <link rel="stylesheet" href="/plugins/fontaw/css/font-awesome.css">
<style>
    .weui-flex{font-size:0.8rem}
    .link-zone a{color: grey}
    .doctor-info{position: relative;padding: 10px}
    #doctorInfo p{padding:2px 0px}
    .avatar{width: 60px;margin-left: 10px}
    .avatar-img{border-radius: 50%}
    .info-block{-webkit-box-flex: 1;display: inline-block}
    .max-width{max-width:50%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
    .weui-cell__bd h4{display: inline-flex;padding-left:0.5rem;font-size: 0.8rem}
    .link-zone i{color: green}
    .weui-tabbar{display: unset}
</style>

<body>
<div class="kk-container">
    <form action="/patient/updPatient" method="post" id="dataForm">
        <input type="hidden" name="patientId" id="patientId">
    <div class="kk-top-block " style="height: 8rem;padding-top:1.5rem;background-color: #A52A2A">
        <div   style="text-align: center;color: white;">
            <h3>
                <img src="/mod-page/images/avatar.jpg" width="60" class=" kk-cycle" id="avatar"/>
            </h3>
            <span style="width: 6rem;height: 2rem;text-align: center;top:46%" id="pname"></span>
            <p  >请立即补充患者资料</p>
            <p  style="font-size:0.6rem">不填写资料，医生无法确定您是谁，请立即填写</p>
        </div>
    </div>

    <div class="weui-panel weui-panel_access" style="margin-top: 0.5rem">
        <div class="weui-cells__title">请认真填写您的信息以便医生识别您</div>
        <div class="weui-cells weui-cells_form">
            <div class="weui-cell ">
                <div class="weui-cell__hd"><label  class="weui-label"> 姓 名 </label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text"  placeholder="请输入姓名" name="patientname">
                </div>
            </div>

            <div class="weui-panel weui-panel_access" >
                <div class=" weui-cells_checkbox" style="display: -webkit-box">
                    <label class="weui-cell weui-check__label" for="s11" style="font-size: 0.8rem;">  性 别 </label>
                    <label class="weui-cell weui-check__label" for="s11">
                        <div class="weui-cell__hd">
                            <input type="radio" value="男" class="weui-check" name="sex" id="s11" checked="checked">
                            <i class="weui-icon-checked"></i>
                        </div>
                        <div class="weui-cell__bd">
                            <p style="font-size:0.8rem">男</p>
                        </div>
                    </label>
                    <label class="weui-cell weui-check__label" for="s12">
                        <div class="weui-cell__hd">
                            <input type="radio" value="女" name="sex" class="weui-check" id="s12">
                            <i class="weui-icon-checked"></i>
                        </div>
                        <div class="weui-cell__bd">
                            <p style="font-size:0.8rem">女</p>
                        </div>
                    </label>
                </div>
            </div>

            <div class="weui-cell weui-cell_select weui-cell_select-before">
                <div class="weui-cell__hd">
                    <select class="weui-select" name="phonePrefix">
                        <option value="1">+86</option>
                    </select>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input" name="phone" type="number" pattern="[0-9]*" placeholder="请输入号码" id="phone">
                </div>
            </div>
          </div>


        <div class="weui-cell">
            <div class="weui-cell__hd"><label for="datetime-picker" class="weui-label" style="font-size: 0.8rem;"> 生 日 </label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" id="datetime-picker" type="text" name="birthdayStr" style="font-size:0.8rem">
            </div>
        </div>


        <div class="weui-cell weui-cell_vcode">
            <div class="weui-cell__hd">
                <label class="weui-label" style="font-size: 0.8rem;">验证码</label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" name="smsCode" style="font-size:0.8rem">
            </div>
            <div class="weui-cell__ft">
                <a class="weui-vcode-btn">获取验证码</a>
            </div>
        </div>
    </div>
    </form>
</div>
<div class="weui-tabbar" style="padding:0.5rem 0rem">
    <span style="font-size:0.6rem;display: block;text-align: center;color: gray">点击"启用杏林名家",即表示您同意<a href="/mod-page/patient/due.html" style="color:dodgerblue">服务条款使用守则</a></span>
    <a class="weui-btn weui-btn_primary" href="javascript:" style="line-height:2;width:90%" id="submitDataBtn"> 启用杏林名家 </a>
</div>


<script src="/lib/jquery-2.1.4.js"></script>
<script src="/js/jquery.form.js"></script>
<script src="/js/home.js"></script>
<script src="/js/jquery-weui.js"></script>
<script>

    $(document).ready(function(){
        var patientId = getQueryString("patientId");
        $.ajax({
            url:"/patient/patientInfo",
            data:{"patientId":patientId},
            success:function(da){
                if(da.msg=="ok"){
                    $("#pname").text(da.data.patientname);
                    $("#avatar").attr("src",da.data.patientPicPath);
                    $("#patientId").val(da.data.patientId);
                }
            }
        });
        $("#datetime-picker").datetimePicker({
            times:function(){
            },
            value:'1980-06-15  '
        });
    });

    $("#submitDataBtn").click(function(){
        //enableOrDisableBtn($("#submitDataBtn"),false);
        $("#dataForm").trigger("submit");
    });

    $(".weui-vcode-btn").click(function(){
        var phone  = $("#phone").val();
        if($.trim(phone)!=""){
            $.ajax({
                url:"/d/doctor/regSMS",
                data:{"phone":phone},
                success:function(da){
                    if(da.code=="10000"){
                        var dead  = 60;
                        $(".weui-vcode-btn").attr("disabled",true);
                        $(".weui-vcode-btn").addClass("sms-disabled");
                        $(".weui-vcode-btn").text(dead+"秒后重发");
                        setInterval(function(){
                            if(dead<=0){
                                $(".weui-vcode-btn").removeClass("sms-disabled");
                                $(".weui-vcode-btn").attr("disabled",false).text("重新发送");
                            }else{
                                $(".weui-vcode-btn").text(dead+"秒后重发");
                                dead--;
                            }
                        },1000);
                    }
                }
            });
        }
    });
</script>
</body>
</html>
